package user;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
 
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.OneToMany;
/**
 *
 * @author Killian
 */
@Entity
@Table(name="DROIT")
class Droit implements java.io.Serializable {
    private static final long serialVersionUID = -8757337896773261247L;
 
    private int id_droit;
    private String type_droit;
    private Set<User> users;

    public Droit() {
    }  

    public Droit(int id_droit) {
        this.id_droit = id_droit;
    }
    
    @Id
    @GeneratedValue
    @Column(name="ID_DROIT")
    public int getId_droit() {
        return id_droit;
    }
    @Column(name="TYPE_DROIT")
    public String getType_droit() {
        return type_droit;
    }

    public void setId_droit(int id_droit) {
        this.id_droit = id_droit;
    }

    public void setType_droit(String type_droit) {
        this.type_droit = type_droit;
    }
    
    @OneToMany(mappedBy="droit")
    public Set<User> getUsers() {
        return users;
    }

    public void setUsers(Set<User> users) {
        this.users = users;
    }  

    @Override
    public String toString() {
        return "Droit{" + "id_droit=" + id_droit + ", type_droit=" + type_droit + '}';
    }
   
    
}